libxc: check in xc_get_tot_pages() that the proper domain is reported
authorVitaly Kuznetsov <vkuznets@redhat.com>
Tue, 2 Dec 2014 15:18:08 +0000 (16:18 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 4 Dec 2014 12:08:19 +0000 (12:08 +0000)
commit5dcd0dcb85941bd92336e01ae3f8c44730099c96
tree6332c87dff37985080bc15fe79d8dfaa2b16f312
parent78b3afe2e5764b3ac61c46042c63619455483999
libxc: check in xc_get_tot_pages() that the proper domain is reported

XEN_DOMCTL_getdomaininfo, which is being used by xc_domain_getinfo(), has
strange interface: it reports first domain which has domid >= requested domid
so all callers are supposed to check that the proper domain(s) was queried
by checking domid. xc_get_tot_pages() doesn't do that. In case the requested
domain was destroyed it will report first domain with domid > requested domid
which is apparently misleading as there is no way xc_get_tot_pages() callers
can figure out that they got tot_pages for some other domain.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_private.c